home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 November & December
/
rerun-1986-11-12.d64
/
morse code 64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
102 lines
100 data 112211,0,12,2111,2121,211,1,1121,221,1111,11,1222,212,1211,22,21,222
110 data 1221,2212,121,111,2,112,1112,122,2112,2122,2211,212212
120 data 12121,111212,1111111,221122,21112,121212,21121,22222
130 data 12222,11222,11122,11112,11111,21111,22111,22211,22221,222111,212121
140 data 162,6,32,255,233,232,224,25,208,248,96
150 al$="abcdefghijklmnopqrstuvwxyz1234567890?,./:;-(":d$(1)="[187]":d$(2)="[162][187]"
160 dimc(91,7),c$(91):cr$=""
170 b=63:e=90:gosub180:b=40:e=59:gosub180:goto200
180 fora=btoe:readl$:forc=1tolen(l$):c(a,c)=val(mid$(l$,c,1))
190 c$(a)=c$(a)+d$(c(a,c)):next:next:return
200 forad=828to838:readn:pokead,n:next
210 readlb$(q):iflb$(q)<>"x"thenq=q+1:goto210
220 poke54277,9:poke54278,144:poke54274,0:poke54275,8:poke54296,15
230 poke53280,6:poke53281,0:print"[147][151] [180][146][185][162]"
240 print" [205][162][162] [190][190] [215] [163] [146][185][163][146][192]"
250 print" [223] "
260 print"[154] [162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][187][187][162][187][153]":m$="international morse code"
270 f$(0)="[151][215][146]":f$(1)="[209]"
280 s(1)=1:s(2)=3:tm=40:tt$=m$:ifflthenprinttab(8)m$:goto400
290 forl=1to24:gosub300:printcr$;"[145][153]";tab(7+l);ml$:next:fl=1:goto400
300 ml$=mid$(m$,l,1):s(0)=2:s=0:poke54272,74:poke54273,42
310 s=s+1:f=1:t=c(asc(ml$),s):iftthen340
320 f=0:ifml$=" "thens(0)=4
330 goto350
340 printf$(f):poke54276,65
350 fordur=1totm*s(t):next:poke54276,64:printf$(0)
360 forrs=1totm:next:iftthen310
370 return
400 printcr$;tab(17);"[158] menu ":printtab(14)"1. code chart"
410 printtab(14)"2. receiving":printtab(14)"3. sending"
420 geta$:ifa$<"1"ora$>"3"then420
430 onval(a$)goto440,650,900
440 t$="[147][153] "+m$+"":printt$"":m$=al$:forl=65to77:n=0
450 ifl<75thenn=asc(mid$(m$,l-38,1))
460 print" ";chr$(l);" ";c$(l);tab(14);chr$(l+13);" ";c$(l+13);
470 printtab(27);chr$(n);" ";c$(n):next
480 poke214,22:print:print" [159]<<< 1.next 2.review 3.menu >>>"
490 geta$:ifa$<"1"ora$>"3"then490
500 onval(a$)goto550,510,230
510 f$(0)=" ":tm=75:b=0:j=1:k=13:gosub530:b=13:k=26
520 gosub530:b=26:k=36:gosub530:goto490
530 forl=jtok:c=4:gosub540:gosub300:c=13:gosub540:b=b+40:next:j=j+13:return
540 forp=btob+11:poke55497+p,c:next:return
550 printt$:forl=37to40:a1=asc(mid$(al$,l,1)):a2=asc(mid$(al$,l+4,1))
560 printtab(5);chr$(a1);" ";c$(a1);tab(22);chr$(a2);" ";c$(a2):print:next
570 printtab(5)"wait (l) "+c$(76)
580 printtab(5)"invite to xmit (k) "+c$(75)
590 printtab(5)"end of message "+c$(41)
600 printtab(5)"end of work "+c$(42)
610 printtab(5)"error "+c$(43)
620 print" [159]<<< press any key for menu >>>"
630 geta$:ifa$=""then630
640 goto230
650 sys828:printcr$;"[145][153]";tab(8);tt$
660 printtab(14);"[158] receive menu "
670 printtab(12)"1. rndm characters":printtab(12)"2. library message"
680 printtab(12)"3. input message":printtab(12)"4. main menu"
690 geta$:ifa$<"1"ora$>"4"then690
700 onval(a$)goto710,800,810,230
710 m$=al$:tm=75
720 sys828:poke198,0:l=int(rnd(.)*43+1):gosub300:printcr$;tab(20);"[158][166]"
730 geta$:ifa$=""then730
740 printcr$;tab(20);a$
750 c$=ml$+" "+c$(asc(ml$)):printtab(20-len(c$)/2);"[153]";c$
760 poke214,21:print:printtab(7);"[159]<<< continue or menu >>>"
770 geta$:ifa$=""then770
780 ifa$="m"then650
790 goto720
800 l=int(rnd(.)*q):m$=lb$(l):goto820
810 sys828:printcr$:input" [153]message";m$
820 sys828:printcr$:input" [153]words per minute";t:tm=700/t
830 printtab(5)"[158]<<< press any key to begin >>>"
840 geta$:ifa$=""then840
850 sys828:forl=1tolen(m$):gosub300
860 printcr$;tab(l+1);:ifasc(ml$)>32thenprint"[157][158][218]"
870 next:sys828:printcr$;m$:poke214,20:print
880 print" [159]<<< press any key for menu >>>"
890 geta$:ifa$=""then890
895 goto650
900 sys828:printcr$;tab(14);"begin sending":t=0
910 poke214,21:print:printtab(7);"[159]<<< press 'm' for menu >>>":rw$="":r=10
920 l=18:m$="":geta$:ifa$="m"then230
930 ifa$=""then920
940 printcr$;tab(14);" ":ifti-d>30thent=t+1
950 d=ti:printf$(1):poke54276,65
960 ifpeek(197)<>64then960
970 poke54276,64:printf$(0):k=2:ifti-d<8thenk=1
980 printcr$;tab(l);"[158]";d$(k):l=l+k:m$=m$+d$(k):d=ti
990 geta$:ifa$<>""then950
1000 ifti-d<15then990
1010 forc=44to90:ifc$(c)<>m$thennext:c=42
1020 poke198,0:printcr$;rw$;tab(t);chr$(c):t=t+1:d=ti:ift<37then920
1030 t=1:rw$=rw$+"":r=r+1:ifr<20then920
1040 goto900
5000 data no one knows their limitations until they try
5010 data "everyone desires to live long, but no one desires to be old."
5020 data "like our shadows, our wishes lengthen as our sun sets"
5030 data it is best not to swap horses when crossing a stream
5040 data "all things that are, are with more spirit chased than enjoyed."
5050 data "experience is the best teacher, except that the tuition is costly."
5060 data x